import unittest
from binary_search import BinarySearch


class TestBinary(unittest.TestCase):
    def setUp(self):
        print('Start to test one case...')

    def tearDown(self):
        print('test one case over!')

    def test_max_one_pass(self):
        binary = BinarySearch(init_value=100, max_value=100, min_value=0, resolution=1)
        ret = binary.update_test_resultresult(True)
        self.assertEqual((True, 100), ret)

    def test_min_one_fail(self):
        binary = BinarySearch(init_value=0, max_value=100, min_value=0, resolution=1)
        self.assertEqual((True, 0), binary.update_test_resultresult(False))

    def test_type_not_matched(self):
        binary = BinarySearch(init_value=0, max_value=100.0, min_value=0, resolution=1)


if __name__ == '__main__':
    unittest.main()
